<?php 
session_cache_expire(999999999);
if(!isset($_SESSION)) 
{ 
	session_start(); 
}

$listreference=$_SESSION['listreference1'];
$namereference=$_SESSION['namereference1'];
$i=$_SESSION['slreference1'];
$co=0;
$k=0;
$idemployees="";
for ($j=0;$j<$i;$j++){
	$idemployees.=$listreference[$j].';';
}


$id=$_REQUEST['id'];
$lang=$_REQUEST['lang'];
$company=$_REQUEST['company'];

//$company='elitech';

$url = 'http://1.234.53.52/mail/sendmail_order.php';
//$url = 'http://localhost/mail/sendmail_order.php';
$fields = array(
								'id' => urlencode($id),
								'company' => urlencode($company),
								'lang' => urlencode($lang),
								'username' => urlencode($_SESSION['fullname']),
								'idemployees' => urlencode($idemployees)
						);
//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string, '&');

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);

//execute post
$result = curl_exec($ch);

//close connection
curl_close($ch);


?>